package trader;

import java.math.BigDecimal;
import java.util.Map;

public class TraderDatabase {
	
	private Map<String, Trader> traders;
	
	public TraderDatabase(Object XMLStream) {
		// for trader in stream
		// parse it and make a trader object
		// and add new trader to trader map
	}
	
	public BigDecimal getCash(String trader) {
		return traders.get(trader).getCash();
	}
	
	public void decrementCash(String trader, BigDecimal amount) {
		traders.get(trader).decrementCash(amount);
	}
	
	public void incrementCash(String trader, BigDecimal amount) {
		traders.get(trader).incrementCash(amount);
	}
	
	public void decrementOre(String trader, String ore, Integer amount) {
		traders.get(trader).decrementOre(ore, amount);
	}
	
	public void incrementOre(String trader, String ore, Integer amount) {
		traders.get(trader).incrementOre(ore, amount);
	}
	
	public Integer getOreAmount(String trader, String ore) {
		return traders.get(trader).getOreAmount(ore);
	}

}
